import { reactive } from 'vue';
import axios from 'axios';

export default function(){
    let imgSrc=reactive(["https:\/\/images.dog.ceo\/breeds\/pembroke\/n02113023_2012.jpg"])
    async function addImg(){
        try{
            let ret=await axios.get("https://dog.ceo/api/breed/pembroke/images/random")
        imgSrc.push(ret.data.message)
        }catch(error){
            window.alert(error)
        }
    }
    return {imgSrc,addImg}

}